<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.qijia.travel.app.*"  %>
<%@ page import="com.qijia.travel.domain.*"  %>
<%@ page import="com.qijia.travel.common.*"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Guide guide = (Guide)session.getAttribute(Constants.USER_KEY);
if(guide.getGuideType()==null||guide.getGuideType()!=1){
out.println("<script>alert('你没有此权限，请联系管理员开通此权限!');window.close();</script>");
response.sendRedirect(basePath+"baseInfo/home.jsp");
}



String pageNo = request.getParameter("pageNo");

int curPage = 1;
try{
   curPage = Integer.parseInt(pageNo);
}catch(NumberFormatException e){}
StatusManager statusManager = new StatusManager();
PageResult pageObj = statusManager.selectStatusList(curPage);


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<title>后台管理平台--旅游网</title>
<link rel="stylesheet" type="text/css" href="../css/layout.css" />
<script language="javascript" type="text/javascript" src="../js/trchgcolor.js"></script>
<!--新建和修改部门弹出窗口JS/CSS开始-->
<link rel="stylesheet" type="text/css" href="../js/ymPrompt/skin/qq/ymPrompt.css" />
<script type="text/javascript" src="../js/ymPrompt/ymPrompt.js"></script>
<!--新建和修改部门弹出窗口JS/CSS结束-->
</head>

<body>
<div id="wrapper">
    <!--头部菜单开始-->
    <jsp:include page="../common/TopMenu.jsp"></jsp:include>
    <!--头部菜单结束-->
	<div id="BreadCrumb">我的位置：基本资料管理 &gt; 状态名称管理</div>
	<div id="REC_content">
	    <fieldset id="BasicInfo" class="mainField">
		    <legend><span class="title">状态名称管理</span></legend>
			<div class="innerCon">
			    <!-- begin tab -->
			    <div class="topControl clearfix">
				    <div id="JobsMgrTabCon" class="itemTabCon">
					    <ul id="JobsMgrTabs" class="itemTabs">
							<li id="dueTab" class="focus"><a href="<%=basePath%>baseInfo/statusManage.jsp" onfocus="this.blur()">状态信息管理</a></li>
							<li id="dueTab" class="blur"><a href="<%=basePath%>baseInfo/treamManage.jsp" >团队信息管理</a></li>
							<li id="dueTab" class="blur"><a href="<%=basePath%>baseInfo/groupManage.jsp">旅行社信息管理</a></li>
					    </ul>
				    </div>
			    </div>
			    <!-- end tab -->
				<div id="mainListCon">
				    <div id="mLC">
					    <ul>
						    <li>
							    <table width="888" style="border:1px solid #eee;" cellpadding="0" cellspacing="1">
								    <tr bgcolor="#f2f6f9">
									    <td width="10%">编号</td>
										<td width="30%">状态名称</td>
										<td width="40%">状态说明</td>
										<td width="20%"></td>
									</tr>
									
									<% 
									int i=1;
									for(Object obj : pageObj.getPageList()){
									  Status status = (Status)obj;
									%>
									<tr class="<%=i%2==0?"list2":"list1"%>">
									    <td><%=status.getStatusId()%></td>
									    <td><%=status.getStatusName()%></td>
										<td><%=status.getStatusDesc()==null?"":status.getStatusDesc()%></td>
										<td>
										  <input name="" type="button" class="btn" onclick="ymPrompt.win('<%=basePath%>baseInfo/newStatus.jsp?statusId=<%=status.getStatusId()%>',480,350,'修改状态信息',closeWin,null,null,true)" value="修改" /> 
										  <input name="" type="button" class="btn" value="删除" onclick="delStatus(<%=status.getStatusId()%>,'<%=status.getStatusName()%>')"/>
									    </td>
									</tr>
									<% }%>
								</table> 
							</li>
							<li style="margin-top:8px;"><input name="" type="button" class="btn" onclick="ymPrompt.win('<%=basePath%>baseInfo/newStatus.jsp',480,350,'新增状态信息',closeWin,null,null,true)" value="新建" /></li>
						</ul>
					</div>
				</div>
			</div>
		</fieldset>
	</div>
	<jsp:include page="../common/Foot.jsp"></jsp:include>
</div>
<script src="<%=basePath%>dwr/interface/statusManager.js"></script>
<script src="<%=basePath%>dwr/engine.js"></script>
<script type="text/javascript">
function delStatus(statusId,statusName){
  if(confirm("确定要删除掉选中的状态["+statusName+"]吗?")){
   statusManager.deleteStatus(statusId,function(data){
     alert("删除成功");
     window.location.reload();
   });
 }else
   return;
}
function closeWin(){
}
</script>
</body>
</html>